#pragma once
#include "FeatureVectors.h"
#include "DataPointManager.h"
#include "cv.h"

/**
This is the base class for a feature extractor. The feature extractor takes in a 
set of images and returns a set of features. It assumes the images have yet to be
loaded, loads the images, gets the features, and then deallocates the images. 

Each feature extractor can generate its data for a sinle image, or for a datapoint mgr.
As a service the feature extractor will also normalize the dataset. 

This is an abstract base class so all feature extractors will inherit from this. 
*/
class CFeatureExtractorBase
{
public:
	CFeatureExtractorBase(void);
	virtual ~CFeatureExtractorBase(void);
	/** 
		Make sure to check the number of color channels in the image. 
	*/
	virtual TFeatureVector ExtractFeaturesFromImage( IplImage * img )=0; 
	virtual TDataSet ExtractFeaturesFromData( CDataPointManager * dpMgr, bool loadImages=true)=0;
	virtual TDataSet GetNormalizationValues( TDataSet &  data);
	virtual TDataSet Normalize( TDataSet& data );
	virtual void SetThreshold( int threshold ){};
	virtual TFeatureVectorLabel GetLabels( void )=0;
protected:
	TFeatureVector GetAllFeatures( TDataSet data, int feature );
	void CalculateAverages( TDataSet data, TFeatureVector& means, TFeatureVector& stdDev ); 
};
